package com.nuc.impl2;

import com.sun.org.apache.bcel.internal.generic.NEW;

/**
 * Time    : 2023/3/28 21:35
 * Author  : 王摇摆
 * FileName: Main.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

public class Main {
    public static void main(String[] args) {
        Monster monster1 = new Monster("小兵", 30);
        Monster monster2 = new Monster("炮车", 80);
        Monster monster3 = new Monster("大怪", 300);

        Role role1 = new Role(new WoodenWeapon());
        Role role2 = new Role(new IronWeapon());
        Role role3 = new Role(new MagicWeapon());

        role1.attack(monster1);
        role1.attack(monster1);
        role1.attack(monster1);
        System.out.println("---------------");

        role2.attack(monster2);
        role2.attack(monster2);
        role2.attack(monster2);
        System.out.println("---------------");

        role3.attack(monster3);
        role3.attack(monster3);
        role3.attack(monster3);
        System.out.println("---------------");
    }
}
